/ Assembly List / LJCDataAccess / DataAccess / GetSchemaOnly

Namespace - LJCDataAccess


Parameters
sql - The SQL command text.
tableMapping - The table map collection.

Returns

A reference to the DataTable object.

Syntax

C#
public DataTable GetSchemaOnly(String sql, DataTableMappingCollection tableMapping = null)

Retrieves the DataTable object with schema only. (E)

Example

C#
// See the DataAccess setup code on the DataAccess class page.

// Retrieves the DataTable object with schema only.
private static void GetSchemaOnly(DataAccess dataAccess)
{
    string sql = "select * from TableName";

    var dataTable = dataAccess.GetSchemaOnly(sql);
    if (dataTable != null)
    {
        foreach (DataColumn dataColumn in dataTable.Columns)
        {
            string value = dataColumn.ColumnName;
        }
    }
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.